<!--
 * @Author: your name
 * @Date: 2021-04-17 15:44:45
 * @LastEditTime: 2021-04-17 15:44:57
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \智慧医疗项目\app\src\views\pages\doctor\office\office.vue
-->
<template>
  <div class="office">
    科室
    <div class="search" v-show="!show">
      <input type="text" placeholder="请输入要搜索的科室" />
    </div>
    <el-table :data="office" style="width: 100%">
      <el-table-column prop="id" label="序号"> </el-table-column>
      <el-table-column prop="name" label="科室"> </el-table-column>
      <el-table-column prop="number" label="人数"> </el-table-column>
      <el-table-column prop="title" label="好评度"> </el-table-column>
      <el-table-column prop="times" label="问诊次数"> </el-table-column>
      <el-table-column prop="handle" label="操作">
        <el-popover placement="right" width="600" trigger="click">
          <el-table :data="office">
            <el-table-column  property="id"></el-table-column>
            <el-table-column  property="name"></el-table-column>
            <el-table-column  property="number"></el-table-column>
            <el-table-column  property="title"></el-table-column>
            <el-table-column  property="times"></el-table-column>
            <el-table-column  property="handle">
              <el-button @click="handleTo">进入</el-button>
            </el-table-column>
          </el-table>
          <el-button slot="reference">查看</el-button>
        </el-popover>
      </el-table-column>
    </el-table>
    <router-view v-show="show"></router-view>
  </div>
</template>

<script>
import axios from "axios"
export default {
  data() {
    return {
      show:false,
      office:[],
    };
  },
  created(){
    axios({
      url:"/api/office"
    }).then(res=>{
      this.office = res.data.office;
      console.log(this.office)
    })
  },
  watch:{
    $route:function(){
      if(this.$route.path==="/home/docList"){
        this.show=true
      }else{
        this.show = false
      }
    }
  },
  methods: {
    handleTo(){
      this.$router.push("/home/docList")
    }
  },
};
</script>

<style>
.el-dropdown-link {
  cursor: pointer;
  color: #409eff;
}
.el-icon-arrow-down {
  font-size: 12px;
}
</style>